package cn.felord.common.mapper;

import cn.felord.common.entity.SysRole;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;

import java.util.Set;

/**
 * <p>
 * 角色表 Mapper 接口
 * </p>
 *
 * @author dax
 * @since 2018 -09-13
 */
public interface SysRoleMapper extends BaseMapper<SysRole> {

    /**
     * Select roles by ant path set.
     *
     * @param antPath the ant path
     * @return the set
     */
    Set<SysRole> selectRolesByAntPath(@Param("antPath") String antPath);

    /**
     * 查询用户角色.
     *
     * @param userId the user id
     * @return the set
     */
    Set<String> selectUserRoleByUserId (@Param("userId") String userId);

    /**
     * 权限列表查询.
     *
     * @return the set
     */
    IPage<SysRole> selectList(Page<SysRole> page);
}
